package com.example.dg.controller;

import com.example.dg.entity.Dd;
import com.example.dg.service.DdServive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/DianDan")
@CrossOrigin
public class DdController {
    @Autowired
    DdServive ddServive;

    @GetMapping("")
    public List<Dd> DianDan(){
        return  ddServive.DianDan();
    }

    @PostMapping("/addDianDan")
    public  int addDianDan(@RequestBody Dd dianDan){
        return ddServive.addDianDan(dianDan);
    }
}
